import {connect} from 'react-redux';
import {Link} from 'react-router';
import {bindActionCreators} from 'redux';
import * as Actions from 'backbone/actions/sidebar';
import Resizable from 'common/components/resizable';

import {Sidebar,Block,List,Item} from 'common/components/LeftSidebar';

class Sidebar_ extends React.Component{
	constructor(){
		super();
		this.state = {};
	}
	render(){
		return (
			<div>
				<Resizable>
					<Sidebar isOpen={this.props.isOpen} >
						<Block isSidebarOpen={this.props.isOpen} icon="fa fa-folder" title="第一个区块">
							<List>
								<Item icon="fa fa-times" isActive={true}><Link to="/blog/home">第一个区块的条目</Link></Item>
								<Item icon="fa fa-commenting" isActive={true}><Link to="/blog/home">第一个区块的条目</Link></Item>
								<Item icon="fa fa-times" isActive={true}><Link to="/blog/home">第一个区块的条目</Link></Item>
								<Item icon="fa fa-times" isActive={true}><Link to="/blog/home">第一个区块的条目</Link></Item>
								<Item icon="fa fa-times" isActive={true}><Link to="/blog/home">第一个区块的条目</Link></Item>
							</List>
						</Block>
						<Block isSidebarOpen={this.props.isOpen} icon="fa fa-folder" title="第二个区块">
							<List>
								<Item></Item>
							</List>
						</Block>
					</Sidebar>
				</Resizable>
			</div>
		)
	}
}

function mapStateToProps(state){
	return {
		isOpen:state.sidebar.isOpen
	}
}
function mapDispatchToProps(dispatch) {
  return bindActionCreators(Actions, dispatch);
}

export default connect(mapStateToProps,mapDispatchToProps)(Sidebar_)
